<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" href="css/iconfont.css">
	<link rel="stylesheet" href="css/global.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="css/swiper.min.css">
	<link rel="stylesheet" href="css/styles.css">
	<link rel="stylesheet"  type="text/css" href="css/sandian/iconfont.css">
	<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
	<script src="js/bootstrap.min.js" charset="UTF-8"></script>
	<script src="js/swiper.min.js" charset="UTF-8"></script>
	<script src="js/global.js" charset="UTF-8"></script>
	<!-- <script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script> -->
	<style type="text/css">
		.smsm ,.snsn{
			display: none;
		}
		#bhbh{
			display: none;
		}
	</style>
	
	<title>秒杀</title>
</head>
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<body>
	<!-- 顶部tab -->
	<div class="tab-header">
		<div class="inner">
			<div class="pull-left">
				<div class="pull-left">嗨，欢迎来到<span class="cr">XXX</span></div>
				<a href="agent_level.html">网店代销</a>
				<a href="temp_article/udai_article4.html">帮助中心</a>
			</div>
			<div class="pull-right">
				<a href="login.html"><span class="cr">登录</span></a>
				<a href="login.html?p=register">注册</a>
				<a href="udai_welcome.html">我的U袋</a>
				<a href="udai_order.html">我的订单</a>
				<a href="udai_integral.html">积分平台</a>
			</div>
		</div>
	</div>
	<div id="body1"></div>
	<div id="ret" class="smsm"></div>
	<!-- <div id="djs2"></div> -->
	<!-- 搜索栏 -->
	<div class="top-search">
		<div class="inner">
			<!-- <a class="logo" href="index.html"></a> -->
			<div class="search-box">
				<form class="input-group">
					<input placeholder="Ta们都在搜XXX" type="text">
					<span class="input-group-btn">
						<button type="button">
							<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
						</button>
					</span>
				</form>
				<p class="help-block text-nowrap">
					<a href="">连衣裙</a>
					<a href="">裤</a>
					<a href="">衬衫</a>
					<a href="">T恤</a>
					<a href="">女包</a>
					<a href="">家居服</a>
					<a href="">2017新款</a>
				</p>
			</div>
			<div class="cart-box">
				<a href="udai_shopcart.html" class="cart-but">
					<i class="iconfont icon-shopcart cr fz16"></i> 购物车 0 件
				</a>
			</div>
		</div>
	</div>
	<!-- 内页导航栏 -->
	<div class="top-nav bg3">
		<div class="nav-box inner">
			<div class="all-cat">
				<div class="title"><i class="iconfont icon-menu"></i> 全部分类</div>
			</div>
			<ul class="nva-list">
				<a href="index.html"><li>首页</li></a>
				<a href="miaosha.html"><li class="active">秒杀</li></a>
				<a href="temp_article/udai_article10.html"><li>企业简介</li></a>
				<a href="temp_article/udai_article5.html"><li>新手上路</li></a>
				<a href="class_room.html"><li>U袋学堂</li></a>
				<a href="enterprise_id.html"><li>企业账号</li></a>
				<a href="udai_contract.html"><li>诚信合约</li></a>
				<a href="item_remove.html"><li>实时下架</li></a>
			</ul>
		</div>
	</div>
	<div class="content inner">
		<section class="panel__div clearfix">
			<!-- <div class="filter-value" id="body"></div> -->
			<div class="filter-value">
				<div class="filter-title" id="yidaojishi" onclick="shuaxin()"></div>
				
				<div  id="body2"></div>
				
			</div>
			
			<div class="html-code">
			
				<div class="content inner" style="margin-bottom: 40px;">
					
					<section class="scroll-floor floor-2">
						<div class="floor-title">
							<i class="iconfont icon-skirt fz16"></i> 女装
							<div class="case-list fz0 pull-right">
								<a href="item_category.html">高端女装</a>
								<a href="item_category.html">时尚女装</a>
								<a href="item_category.html">上装</a>
								<a href="item_category.html">下装</a>
								<a href="item_category.html">裙装</a>
								<a href="item_category.html">内衣</a>
							</div>
						</div>
						<div class="con-box">
							<!-- <a class="left-img hot-img" href="">
								<img src="images/floor_1.jpg" alt="" class="cover">
								<div class="yanshi">
									<span class="qian-zi">倒计时</span>
									<i class="iconfont icon-shandian" style="font-size: 150px;"></i>
									<span class="hou-zi" id="jieshu">距离倒计时结束还剩:</span>
									<span class="daojishi"></span>
								</div>
							</a> -->
							
						</div>
					</section>
					<section class="scroll-floor floor-3">
						<!-- <div class="floor-title">
							<i class="iconfont icon-fushi fz16"></i> 男装
							<div class="case-list fz0 pull-right">
								<a href="item_category.html">高端女装</a>
								<a href="item_category.html">时尚女装</a>
								<a href="item_category.html">上装</a>
								<a href="item_category.html">下装</a>
								<a href="item_category.html">裙装</a>
								<a href="item_category.html">内衣</a>
							</div>
						</div> -->
						<div class="con-box">
							
						</div>
					</section>
					<!-- <section class="scroll-floor floor-4">
						<div class="floor-title">
							<i class="iconfont icon-kid fz16"></i> 活力童装
							<div class="case-list fz0 pull-right">
								<a href="item_category.html">高端女装</a>
								<a href="item_category.html">时尚女装</a>
								<a href="item_category.html">上装</a>
								<a href="item_category.html">下装</a>
								<a href="item_category.html">裙装</a>
								<a href="item_category.html">内衣</a>
							</div>
						</div> 
						</div>
						</div>
					</section> -->
				</div>
			</div>
		</section>
	</div>
	<!-- 右侧菜单 -->
	<div class="right-nav">
		<ul class="r-with-gotop">
			<li class="r-toolbar-item">
				<a href="udai_welcome.html" class="r-item-hd">
					<i class="iconfont icon-user" data-badge="0"></i>
					<div class="r-tip__box"><span class="r-tip-text">用户中心</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="udai_shopcart.html" class="r-item-hd">
					<i class="iconfont icon-cart"></i>
					<div class="r-tip__box"><span class="r-tip-text">购物车</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="udai_collection.html" class="r-item-hd">
					<i class="iconfont icon-aixin"></i>
					<div class="r-tip__box"><span class="r-tip-text">我的收藏</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="" class="r-item-hd">
					<i class="iconfont icon-liaotian"></i>
					<div class="r-tip__box"><span class="r-tip-text">联系客服</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="issues.html" class="r-item-hd">
					<i class="iconfont icon-liuyan"></i>
					<div class="r-tip__box"><span class="r-tip-text">留言反馈</span></div>
				</a>
			</li>
			<li class="r-toolbar-item to-top">
				<i class="iconfont icon-top"></i>
				<div class="r-tip__box"><span class="r-tip-text">返回顶部</span></div>
			</li>
		</ul>
		
	</div>
	<!-- 底部信息 -->
	<div class="footer">
		<div class="footer-tags">
			<div class="tags-box inner">
				<div class="tag-div">
					<img src="images/icons/footer_1.gif" alt="厂家直供">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_2.gif" alt="一件代发">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_3.gif" alt="美工活动支持">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_4.gif" alt="信誉认证">
				</div>
			</div>
		</div>
		<div class="footer-links inner">
			<dl>
				<dt>XXX</dt>
				<a href="temp_article/udai_article10.html"><dd>企业简介</dd></a>
				<a href="temp_article/udai_article11.html"><dd>加入U袋</dd></a>
				<a href="temp_article/udai_article12.html"><dd>隐私说明</dd></a>
			</dl>
			<dl>
				<dt>服务中心</dt>
				<a href="temp_article/udai_article1.html"><dd>售后服务</dd></a>
				<a href="temp_article/udai_article2.html"><dd>配送服务</dd></a>
				<a href="temp_article/udai_article3.html"><dd>用户协议</dd></a>
				<a href="temp_article/udai_article4.html"><dd>常见问题</dd></a>
			</dl>
			<dl>
				<dt>新手上路</dt>
				<a href="temp_article/udai_article5.html"><dd>如何成为代理商</dd></a>
				<a href="temp_article/udai_article6.html"><dd>代销商上架教程</dd></a>
				<a href="temp_article/udai_article7.html"><dd>分销商常见问题</dd></a>
				<a href="temp_article/udai_article8.html"><dd>付款账户</dd></a>
			</dl>
		</div>
		<div class="copy-box clearfix">
			<ul class="copy-links">
				<a href="agent_level.html"><li>网店代销</li></a>
				<a href="class_room.html"><li>U袋学堂</li></a>
				<a href="udai_about.html"><li>联系我们</li></a>
				<a href="temp_article/udai_article10.html"><li>企业简介</li></a>
				<a href="temp_article/udai_article5.html"><li>新手上路</li></a>
			</ul>
			<!-- 版权 -->
			<p class="copyright">
				© 2005-2017 XXX 版权所有，并保留所有权利<br>
				ICP备案证书号：闽ICP备XXX号-2&nbsp;&nbsp;&nbsp;&nbsp;福建省宁德市XXX&nbsp;&nbsp;&nbsp;&nbsp;Tel: XXX&nbsp;&nbsp;&nbsp;&nbsp;E-mail: XXX@qq.com
			</p>
		</div>
	</div>
</body>

<script  type="text/javascript">
			
			chashanmian () 
			function chashanmian () {
					
				$.ajax({
					method:"post",
					url:"http://127.0.0.1:16200/huoqusj",
					
					success:function(date){
						var str="";
						var str1="";
						for(i in date){
							
							var xzsj=+new Date();
							var xx=new Date();
							var startTime=new Date(date[i].openingtime);
							var startTime1=new Date(date[i].endtime);
						
							var jin=xx.getDate();
							var sjk=startTime1.getDate();
							
							var hour1=startTime.getHours();//获取小时
							hour1=hour1>9?hour1:"0"+hour1;
							// alert(hour1)
							var djs=(startTime-xzsj)/1000;
							var miao=parseInt(djs%60)
							
							var djs2=(startTime1-xzsj)/1000;
							var miao2=parseInt(djs2%60)
							
							if(xzsj>startTime1){
								gai(date[i].endtime);
							}
							
							// alert(miao)
							if(jin<=sjk && miao>0 ){
								
							var djs=(startTime-xzsj)/1000;
							var shi= parseInt(djs/60/60%24)
							var fen= parseInt(djs/60%60)
							var miao=parseInt(djs%60)
							shi=shi>9?shi:"0"+shi 
							miao=miao>9?miao:"0"+miao;
							fen=fen>9?fen:"0"+fen;
							var sj=shi+":"+fen+":"+miao
							// alertsjk-jin
							if((sjk-jin)>=1){
								mt="明天";
								str+="<div class='filter-title' onclick=dianji(this,"+date[i].commodityid+","+hour1+","+date[i].msid+")>"+mt+hour1+':00 '+"<span>即将开始</span>"+"<span class='xuanzhe'></span>"+"</div>";
							}else{
								str+="<div class='filter-title' onclick=dianji(this,"+date[i].commodityid+","+hour1+","+date[i].msid+")>"+hour1+':00 '+"<span>即将开始</span>"+"<span class='xuanzhe'></span>"+"</div>";
							}
							
							// str+="<div class='filter-title' onclick='cpdelect(this)'>"+date[i].openingtime+"结束"+date[i].endtime+ class='ysys'
							// // "<input type='submit' onclick='cpdelect("+date[i].openingtime+")' value='点'>"+
							// "</div>";
							var a=document.getElementById("body2");
							a.innerHTML=str;
							
							}
							else if(miao2>0)
							{
									var djs=(startTime1-xzsj)/1000;
									var shi= parseInt(djs/60/60%24)
									var fen= parseInt(djs/60%60)
									var miao=parseInt(djs%60)
									shi=shi>9?shi:"0"+shi 
									miao=miao>9?miao:"0"+miao;
									fen=fen>9?fen:"0"+fen;
									var sj=shi+":"+fen+":"+miao
									
								str+="<div onclick=dianji("+date[i].commodityid+","+hour1+","+date[i].msid+")>"+"<span id='bhbh'>"+date[i].commodityid+"</span>"+"<span class='smsm'>"+date[i].endtime+"</span>"+"<span class='snsn'>"+date[i].openingtime+"</span>"+"</div>"
								str1+="<div onclick=dianji("+date[i].commodityid+","+hour1+","+date[i].msid+")>"+"<span id='bhbh'>"+date[i].commodityid+"</span>"+hour1+':00 正在秒杀'+"</div>"
							if(shi<=2){
									// alert(sj)
									var b=document.getElementById("body1");
									b.innerHTML=str;
									var a=document.getElementById("yidaojishi");
									a.innerHTML=str1;
									
								}
							}
						}
					// document.getElementById("body2").innerHTML=sj;
					},
					
				});
			}
			// 定时器 倒时间
			var realtime=setInterval(yidaojishi,10);
			function yidaojishi() {
				var jieshu=document.getElementsByClassName("smsm");//这个是获取结束时间
				var kaishi=document.getElementsByClassName("snsn");//这个是获取开始时间
				// alert(kaishi[0].innerHTML)
				var xzsj=+new Date();
				var startTime=+new Date(jieshu[0].innerHTML);
				
				//用来获取开始的时间
				var ksjs=new Date(kaishi[0].innerHTML);
				var hour1=ksjs.getHours();//获取小时
						//第一个倒计时
						var djs=(startTime-xzsj)/1000;
						var shi= parseInt(djs/60/60%24)
						var fen= parseInt(djs/60%60)
						var miao=parseInt(djs%60)
						shi=shi>9?shi:"0"+shi 
						miao=miao>9?miao:"0"+miao;
						fen=fen>9?fen:"0"+fen;
						var sj=shi+":"+fen+":"+miao
						
						if(xzsj>startTime){
							window.location.reload();
						}else{
						document.getElementById("yidaojishi").innerHTML=hour1+":00 正在秒杀距离结束还:"+sj;
						}
					}
		
			
			//时间过期改状态
			function gai (endtime) {
				// alert(endtime);
				$.ajax({
					method:"post",
					url:"http://127.0.0.1:16200/gai",
					dataType:"json",
					data:{endtime:endtime},
					success:function(date){
						if(date==true){
							alert("本场秒杀活动结束啦，看看最新的秒杀吧~");
							window.location.reload();//刷新页面
						}
				},
				})
			}
			
			
			
			//第一个查图片
			var diyige=setInterval(diyige,10);
			function diyige () {
				clearInterval(this.diyige)
				var commodityid=document.getElementById("bhbh").innerHTML;
				$.ajax({
				method:"post",
					url:"http://127.0.0.1:16200/qiehuan",
					dataType:"json",
					data:{commodityid:commodityid},
					success:function(date){
						str="";
						for(i in date){
							str+="<a href='item_show.html' class='floor-item'>"+
							"<div class='item-img hot-img'>"+
							"<img src="+date[i].commodity_picture+" alt="+date[i].commodity_description+" class='cover'>"+
							"</div>"+
							"<div class='price clearfix'>"+
							"<span class='pull-left cr fz16'>秒杀价：￥"+date[i].commodity_price+"</span>"+
							"<span class='pull-right c6'>销量"+date[i].sales_volume+"</span>"+
							"</div>"+
							"<div class='name ep' title="+date[i].commodity_description+">"+date[i].commodity_description+"</div>"+
							"<input type='button' class='annvnv1' value='立即抢购'>"+
							"</a>"
							
						}var box=document.getElementsByClassName("con-box");
						// for(i in box){
							box[0].innerHTML=str;
							// }
						},
					})
			}
			function shuaxin () {
				window.location.reload();
			}
			
			//切换图片 点击之后要改变颜色
			function dianji(t,commodityid,hour1,msid) {
				var yidaojishi=document.getElementById("yidaojishi").innerHTML;
				var fuzhi=yidaojishi.split(" ",1)
				document.getElementById("yidaojishi").innerHTML=fuzhi+' 进行中';
				// alert(commodityid)
				// alert(hour1)
				alert(msid)
				
				selectmsid(msid,t);
				
				$.ajax({
				method:"post",
					url:"http://127.0.0.1:16200/qiehuan",
					dataType:"json",
					data:{commodityid:commodityid},
					success:function(date){
						str="";
						for(i in date){
							
							str+="<a href='item_show.html' class='floor-item'>"+
							"<div class='item-img hot-img'>"+
							"<img src="+date[i].commodity_picture+" alt="+date[i].commodity_description+" class='cover'>"+
							"</div>"+
							"<div class='price clearfix'>"+
							"<span class='pull-left cr fz16'>秒杀价：￥"+date[i].commodity_price+"</span>"+
							"<span class='pull-right c6'>销量"+date[i].sales_volume+"</span>"+
							"</div>"+
							"<div class='name ep' title="+date[i].commodity_description+">"+date[i].commodity_description+"</div>"+
							"<input type='button' class='annvnv2' value='即将开始'>"+
							
							"</a>"
							
							var box=document.getElementsByClassName("con-box");
						}
							// for(i in box){
								box[0].innerHTML=str;
								// }
						// document.getElementById("")
						},
					})
			}
			function selectmsid (msid,t) {
				// alert(t.innerHTML)
				clearInterval(realtime);
				$.ajax({
					method:"post",
					url:"http://127.0.0.1:16200/selectmsid",
					dataType:"json",
					data:{msid:msid},
					success:function(date){
						var ret;
						ret=date[0].openingtime;
						document.getElementById("ret").innerHTML=ret;
						setInterval(huomian,1000)
					
				},
			})
			}
			function huomian () {
				var openingtime=document.getElementById("ret").innerHTML;
				
				var duibi=openingtime.substr(10,14)
				// alert(duibi)
				// setInterval(huomian,1000)
				var xzsj=+new Date();
				var xx=new Date();
				var startTime=new Date(openingtime);
				
				var djs=(startTime-xzsj)/1000;
				var shi= parseInt(djs/60/60%24)
				var fen= parseInt(djs/60%60)
				var miao=parseInt(djs%60)
				shi=shi>9?shi:"0"+shi 
				miao=miao>9?miao:"0"+miao;
				fen=fen>9?fen:"0"+fen;
				var sj=shi+":"+fen+":"+miao
				// var ss=document.getElementById("djs2").innerHTML=sj;
				
				var xz=document.getElementsByClassName("xuanzhe");
				var pd=shi.substr(1,2)
				// alert(pd)
				// window.location.reload();
				if(pd==1||pd==0){
				 xz[0].innerHTML=" 距离开始还："+sj
					xz[1].innerHTML=""
					xz[2].innerHTML=""
					xz[3].innerHTML=""
				}
				else if(pd==2||pd==3){
				xz[1].innerHTML=" 距离开始还："+sj
				xz[0].innerHTML=""
				xz[2].innerHTML=""
				xz[3].innerHTML=""
				}
				else if(pd==4||pd==5){
				xz[2].innerHTML=" 距离开始还："+sj
				xz[0].innerHTML=""
				xz[1].innerHTML=""
				xz[3].innerHTML=""
				}else{
				xz[3].innerHTML=" 距离开始还："+sj
				xz[1].innerHTML=""
				xz[2].innerHTML=""
				xz[0].innerHTML=""
				}
				
			}
</script>
</html>